//
//  ganttView.m
//  testPlanningV2
//
//  Created by richard_local on 17/09/13.
//  Copyright (c) 2013 ierdre.com. All rights reserved.
//

#import "ganttView.h"

@implementation ganttView
@synthesize  data;
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/
- (id)initWithCoder:(NSCoder *)decoder{

    self = [super initWithCoder:decoder];

    /*CGRect myFrame = self.frame;
    myFrame.size.width = 50;
    myFrame.origin.x = 50;
    self.frame = myFrame;*/
    return self;
}
- (void)drawRect:(CGRect)rect {
    
    //setSize and position of gantt view
  
    NSLog (@" DATA %@",self.data);
    
    [super drawRect:rect];
  /*  CGRect myFrame = self.frame;
    myFrame.size.width = 100;
    myFrame.origin.x = 10;
    self.frame = myFrame;*/
    //**************
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    
    // Draw them with a 2.0 stroke width so they are a bit more visible.
    CGContextSetLineWidth(context, 2.0);
    
    CGContextMoveToPoint(context, 0,0); //start at this point
    
    CGContextAddLineToPoint(context, 20, 20); //draw to this point
    
    // and now draw the Path!
    CGContextStrokePath(context);
    
    
    
}
@end
